﻿using System;
using System.Collections.Generic;
using System.Linq;
using ExpenseSystem.Common;
using ExpenseSystem.Fether;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;

namespace ExpenseSystem.Fether
{
    public class DeliveryDetailFetcher :NormalFetcher<DeliveryDetailModel>, IDetailFetcher<DeliveryDetailModel>
    {
        public IList<DeliveryDetailModel> ListByMainId( long site, long mainId, out string message, out int rows)
        {
            IList<DeliveryDetailModel> result = List( site, OrderBy.GetDefault(), Limit.GetDefault(), out message, out rows, Restrain.Eq("DeliveryId", mainId).And(Restrain.Eq("Avaliable", true)));
            return result;
        }
        public IList<DeliveryDetailModel> ListByOrder(long site,long order,out string message,out int rows)
        {
            IList<DeliveryDetailModel> result = List(site, OrderBy.GetDefault(), Limit.GetDefault(), out message, out rows, Restrain.Eq("OrderId", order).And(Restrain.Eq("Avaliable", true)));
            return result;
        }
    }
}
